<template>
  <view class="ai-btn ai-icon-btn" :class="styleClass" @click="handleClick">
    <ai-icon v-if="icon" :type="icon" :color="iconColor" :size="size"></ai-icon>
    <image class="img" v-if="!icon && img" :src="img"></image>
  </view>
</template>

<script>
  export default {
    name: "ai-icon-button",
    emits: [ "click" ],
    props: {
      icon: String,
      size: Number,
      img: String,
      iconColor: String,
      styleClass: String
    },
    data() {
      return {

      };
    },
    methods: {
      handleClick() {
        this.$emit("click")
      }
    }
  }
</script>

<style lang="scss">
  @import "@/styles/_button.scss";

</style>